const fs = require("fs");
const path = require("path");

let readPath = path.join(__dirname, "from.txt");
let writePath = path.join(__dirname, "to.txt");

let reader = fs.createReadStream(readPath);
let writer = fs.createWriteStream(writePath);
reader.on("data", function (chrunk) {
    chrunk = chrunk.toString().toUpperCase();
    console.log(chrunk);
})
reader.pipe(writer);